package com.yunxi.service.localService.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.codingapi.txlcn.tc.annotation.LcnTransaction;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yunxi.dao.order.OrderAutoMatchCarMapper;
import com.yunxi.model.order.OrderAutoMatchCar;
import com.yunxi.order.pojo.OrderApproveAutoMatchCarReqVO;
import com.yunxi.order.pojo.OrderApproveAutoMatchCarRespVO;
import com.yunxi.order.pojo.OrderApproveRespVO;
import com.yunxi.service.localService.OrderApproveAutoMatchCarService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 自动配车
 */
@Service(value = "orderApproveAutoMatchCarServiceImpl")
public class OrderApproveAutoMatchCarServiceImpl  extends ServiceImpl<OrderAutoMatchCarMapper, OrderAutoMatchCar> implements OrderApproveAutoMatchCarService {

    @Override
    @Transactional
    public PageInfo<OrderApproveAutoMatchCarRespVO> queryStock(String orderCarId,int pageIndex,int pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        List<OrderApproveAutoMatchCarRespVO> resp = this.baseMapper.queryStock(orderCarId);
        PageInfo<OrderApproveAutoMatchCarRespVO> pageInfo = new PageInfo<>(resp);
        return pageInfo;
    }

    @Override
    @Transactional
    public PageInfo<OrderApproveAutoMatchCarRespVO> queryProductionLine(String orderCarId,int pageIndex,int pageSize) {
        PageHelper.startPage(pageIndex,pageSize);
        List<OrderApproveAutoMatchCarRespVO> resp = this.baseMapper.queryProductionLine(orderCarId);
        PageInfo<OrderApproveAutoMatchCarRespVO> pageInfo = new PageInfo<>(resp);
        return pageInfo;
    }
}
